package org.kl.bf.entity.basic;

import java.sql.Timestamp;

import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.kl.bf.entity.AuditableEntity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;

/**
 * 
 * @Author hqm
 * @CreateTime 2014年6月23日 下午9:53:47
 */
@Entity
@Table(name = "basic_notify_info")
public class NotifyInfo extends AuditableEntity {
	private static final long serialVersionUID = 8154994890761955210L;
	private String pid;
	private String title;
	/**
	 * 信息状态（0没删（默认），1回收，已2删）
	 */
	private int status;
	/**
	 * 信息属性（1未读（默认），0已读，2草稿）
	 */
	private int attribute;
	/**
	 * 是否有附件（0，没有（默认），1有）
	 */
	private int hasNotifyAttachment;
	private User receiver;
	private User sender;
	/**
	 * 邮件是属于发送方还是接收方(0:发送方（默认），1:接收方，2:抄送方，3:密送方)
	 */
	private int owner;
	private Timestamp sendTime;
	private String receiversName;
	private String ccsName;
	private String bccsName;
	private String joinFileId;// 所属关联附件

	/**
	 * 带有HTML样式的收件人，发件箱显示
	 */
	private String colorRecerverName;
	private NotifyContent notifyContent;
	private BasicFile basicFile;

	private String ccId;
	private String bccId;
	private String isSendSMS;

	@ManyToOne
	@JoinColumn(name = "receiver_id")
	public User getReceiver() {
		return receiver;
	}

	public void setReceiver(User receiver) {
		this.receiver = receiver;
	}

	@ManyToOne
	@JoinColumn(name = "sender_id")
	public User getSender() {
		return sender;
	}

	public void setSender(User sender) {
		this.sender = sender;
	}

	public String getPid() {
		return pid;
	}

	public void setPid(String pid) {
		this.pid = pid;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public int getAttribute() {
		return attribute;
	}

	public void setAttribute(int attribute) {
		this.attribute = attribute;
	}

	public int getHasNotifyAttachment() {
		return hasNotifyAttachment;
	}

	public void setHasNotifyAttachment(int hasNotifyAttachment) {
		this.hasNotifyAttachment = hasNotifyAttachment;
	}

	public int getOwner() {
		return owner;
	}

	public void setOwner(int owner) {
		this.owner = owner;
	}

	// 设定JSON序列化时的日期格式
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
	public Timestamp getSendTime() {
		return sendTime;
	}

	public void setSendTime(Timestamp sendTime) {
		this.sendTime = sendTime;
	}

	public String getReceiversName() {
		return receiversName;
	}

	public void setReceiversName(String receiversName) {
		this.receiversName = receiversName;
	}

	public String getCcsName() {
		return ccsName;
	}

	public void setCcsName(String ccsName) {
		this.ccsName = ccsName;
	}

	public String getBccsName() {
		return bccsName;
	}

	public void setBccsName(String bccsName) {
		this.bccsName = bccsName;
	}

	public String getJoinFileId() {
		return joinFileId;
	}

	public void setJoinFileId(String joinFileId) {
		this.joinFileId = joinFileId;
	}

	@Transient
	public String getColorRecerverName() {
		return colorRecerverName;
	}

	public void setColorRecerverName(String colorRecerverName) {
		this.colorRecerverName = colorRecerverName;
	}

	@Transient
	@JsonIgnore
	public NotifyContent getNotifyContent() {
		return notifyContent;
	}

	public void setNotifyContent(NotifyContent notifyContent) {
		this.notifyContent = notifyContent;
	}

	@Transient
	@JsonIgnore
	public BasicFile getBasicFile() {
		return basicFile;
	}

	public void setBasicFile(BasicFile basicFile) {
		this.basicFile = basicFile;
	}

	@Transient
	public String getCcId() {
		return ccId;
	}

	public void setCcId(String ccId) {
		this.ccId = ccId;
	}

	@Transient
	public String getBccId() {
		return bccId;
	}

	public void setBccId(String bccId) {
		this.bccId = bccId;
	}

	@Transient
	public String getIsSendSMS() {
		return isSendSMS;
	}

	public void setIsSendSMS(String isSendSMS) {
		this.isSendSMS = isSendSMS;
	}

}